/**
 * Copyright (c) 2016-2019 人人开源 All rights reserved.
 *
 * https://www.renren.io
 *
 * 版权所有，侵权必究！
 */

package com.xiaoniu.forum;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.Arrays;


@SpringBootApplication
@EnableCaching
public class RenrenApplication implements CommandLineRunner {
	public static void main(String[] args) {
		ConfigurableApplicationContext run = SpringApplication.run(RenrenApplication.class, args);
		//Arrays.stream(run.getBeanDefinitionNames()).forEach(System.out::println);
	}

	//SpringBoot启动时，会运行该方法
	@Override
	public void run(String... args) throws Exception {
		//关闭fastjson工具类的重复引用
		JSON.DEFAULT_GENERATE_FEATURE |= SerializerFeature.DisableCircularReferenceDetect.getMask();
	}

}